须知: 表格绑定数据:data='tableData'
      渲染数据el-table-column里加prop=tableData里的字段

<template>
  <div class="">
    <div class="top">
      <!-- 筛选 -->
      <div class="screen" style="margin: 25px">
        <div style="width: 30%">筛选：</div>
        <el-input type="search" style="width: 30%" placeholder="请输入关键字" v-model.trim="inputvalue" @keyup.enter.native="search"></el-input>
        <el-button slot="append" icon="el-icon-search" @click="search()">
        </el-button>
      </div>
    </div>

    <!-- 表格 -->

    <div class="table" style="margin: 25px">
      <el-table :data="tableData" style="width: 100%" max-height="500">
        <!-- 事件 -->

        <el-table-column label="时间" prop="date">
          <template slot-scope="scope">
            <span v-html="showData(scope.row.date, inputvalue)"></span>
          </template>
        </el-table-column>

        <!-- 用户名 -->

        <el-table-column label="用户名" prop="name">
          <template slot-scope="scope">
            <span v-html="showData(scope.row.name, inputvalue)"></span>
          </template>
        </el-table-column>

        <!-- 地址 -->

        <el-table-column label="地址" prop="address">
          <template slot-scope="scope">
            <span v-html="showData(scope.row.address, inputvalue)"></span>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      inputvalue: "",
      tableData: [
        {
          date: "2016-05-02",
          name: "张三",
          address: "上海市普陀区金沙江路 1518 A弄",
        },
        {
          date: "2016-05-04",
          name: "李四",
          address: "上海市普陀区金沙江路 1517 b弄",
        },
        {
          date: "2016-05-01",
          name: "王五",
          address: "上海市普陀区金沙江路 1519 c弄",
        },
        {
          date: "2016-05-03",
          name: "赵六",
          address: "上海市普陀区金沙江路 1516 d弄",
        },
      ],
    };
  },

  components: {},

  mounted() {},

  methods: {
    search() {
      this.tableData.forEach((item) => {
        for (const key in item) {
          console.log(item[key]);
        }
      });
    },
    showData(val, searchData) {
      const Reg = new RegExp(searchData, "g"); //全局匹配  i是忽略大小写  $&所有字符
      //world/gi(取出所有单词"world",不管大小写)
      if (val) {
        const res = val.replace(
          Reg,
          '<span style="background-color: yellow;">$&</span>'
        );
        return res;
      }
    },
  },
};
</script>

<style lang="scss">
</style>
